import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({

  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/index'),
      meta: { title: '百姓大院', canBack: true }
    },
    {
      path: '/type',
      name: 'type',
      component: () => import('@/views/type'),
      meta: { title: '分类', canBack: true }
    },
    {
      path: '/cart',
      name: 'cart',
      component: () => import('@/views/cart'),
      meta: { title: '购物车', canBack: true }
    },
    {
      path: '/my',
      name: 'my',
      component: () => import('@/views/my'),
      meta: { title: '我的', canBack: true }
    },
    {
      path: '/address',
      name: 'address',
      component: () => import('@/views/address'),
      meta: { title: '选择地址', canBack: true }
    },
    {
      path: '/addAddress',
      name: 'addAddress',
      component: () => import('@/views/addAddress'),
      meta: { title: '编辑地址', canBack: true }
    },
    {
      path: '/allOrder',
      name: 'allOrder',
      component: () => import('@/views/allOrder'),
      meta: { title: '全部订单', canBack: true }
    },
    {
      path: '/orderDetails',
      name: 'orderDetails',
      component: () => import('@/views/orderDetails'),
      meta: { title: '订单详情', canBack: true }
    },
    {
      path: '/submitOrder',
      name: 'submitOrder',
      component: () => import('@/views/submitOrder'),
      meta: { title: '提交订单', canBack: true }
    },
    {
      path: '/productDetails',
      name: 'productDetails',
      component: () => import('@/views/page-details-product'),
      meta: { title: '商品详情', canBack: true }
    },
    {
      path: '/buySucc',
      name: 'buySucc',
      component: () => import('@/views/buySucc'),
      meta: { title: '购买成功', canBack: true }
    },
    {
      path: '/serachProduct',
      name: 'serachProduct',
      component: () => import('@/views/serachProduct'),
      meta: { title: '苹果', canBack: true }
    },
    {
      path: '/searchPage',
      name: 'searchPage',
      component: () => import('@/views/searchPage'),
      meta: { title: '苹果', canBack: true }
    }
  ]
})
